package Course;
import java.util.ArrayList;
import java.util.List;
public class Teacher {
    private String teacherId;
    private String name;
    private String gender;
    private List<Course> taughtCourses = new ArrayList<>();

    // 构造方法
    public Teacher(String teacherId, String name, String gender) {
        this.teacherId = teacherId;
        this.name = name;
        this.gender = gender;
    }

    // 教师开课方法
    public Course openCourse(String courseId, String courseName, String location, String time) {
        Course course = new Course(courseId, courseName, location, time, this);
        taughtCourses.add(course);
        return course;
    }

    // Getter方法
    public String getTeacherId() {
        return teacherId;
    }

    public String getName() {
        return name;
    }
}
